package me.chan.demo;

import java.io.File;
import java.io.FileFilter;

public class ListHiddenFile {

	public static void main(String[] args) {
		//The code to list the hidden files of the given path is written as followings below jdk1.8
		/*
		File[] files = new File("/home/cxj").listFiles(new FileFilter(){
			
			@Override
			public boolean accept(File pathname) {
				return pathname.isHidden();
			}
			
		});	
		
		for (File file : files) {
			System.out.println(file.getName());
		}*/
		
		//following is written with jdk1.8
		File[] hiddenFiles = new File("/home/cxj").listFiles(File::isHidden);
		for (File file : hiddenFiles) {
			System.out.println(file.getName());
		}
		
		
	}
}
